package com.yuan.statemachine.core;


/**
 * @author wjwei
 */
public class StateResponseBody {

    private Integer code;
    private Object data;
    private String message;

    public static StateResponseBody stateFail(StateResponseCode responseCode) {
        return getResponseBody(responseCode);
    }

    private static StateResponseBody getResponseBody(StateResponseCode responseCode) {
        StateResponseBody body = new StateResponseBody();
        body.setCode(responseCode.getCode());
        body.setMessage(responseCode.getMessage());
        return body;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    @Override
    public String toString() {
        return "StateResponseBody{" +
                "code=" + code +
                ", data=" + data +
                ", message='" + message + '\'' +
                '}';
    }
}
